const getDateTime = (date = (new Date())) => {
    let fullYear = date.getFullYear();
    let month = date.getMonth();
    month = (month + 1) < 10 ? '0' + (month + 1) : (month + 1);
    let day = date.getDate();
    day = day < 10 ? '0' + day : day;
    let houre = date.getHours();
    houre = houre < 10 ? '0' + houre : houre;
    let minutes = date.getMinutes();
    minutes = minutes < 10 ? '0' + minutes : minutes;
    let second = date.getSeconds();
    second = second < 10 ? '0' + second : second;
    return `${fullYear}-${month}-${day} ${houre}:${minutes}:${second}`;
}

module.exports = {
    getDateTime
}